Add RawValue support for non-converted Payloads#1664
Conversation
|
I believe we need to return |
|
I'm really not clear how For now, I'd focus on the outbound path only, simply to support return value of built-in queries. For inbound payloads, that might have to wait only we add support for type hints on receivers. |
62de924 to
cec9e55
Compare
cec9e55 to
573c2ca
Compare
|
I've written this in the PR description:
Let me know if this makes sense to you. |
| */ | ||
| import * as wf from '@temporalio/workflow'; | ||
| import type { EnhancedStackTrace } from '@temporalio/workflow/lib/interfaces'; | ||
| import { defaultPayloadConverter } from '@temporalio/common/lib/converter/payload-converter'; |
mjameswh
left a comment
There was a problem hiding this comment.
We're almost there, but still a bit more.
85f69bd to
024b319
Compare
mjameswh
left a comment
There was a problem hiding this comment.
Just a minor typedoc thing to fix, can merge after that.
What was changed
Added
RawValuesupport for non-converted Payloads - a thin wrapper aroundPayload.RawValueis intended to be used for payloads that bypasses users custom payload converters in favour of the default payload converter.TS does not include type hints or similar when converting from a payload back to its original representation. As such, the best we can do is just send the payload as is and have users convert it back to its original representation.
The existing builtin queries now return a
RawValuethat wraps their former returned values. The return types of the builtin queries however, maintain their existing type (this is because receivers of these queries will get the payload itself, not theRawValue). This is breaking change as consumers of these builtin queries will need to make sure they decode the builtin payloads correctly.Closes [Feature Request] Support "RawValue" non-converted values #1629, [Feature Request] Built-in query responses should use "RawValue" #1630
How was this tested:
Added short integration test, modified the existing built-in metadata test.
Any docs updates needed?
Possibly. Maybe for the change to the built-in metadata query.